home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DView.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  13.0 KB  |  299 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DView.p
  3.  
  4.      Contains:    View types and routines                                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT QD3DView;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __QD3DVIEW__}
  27. {$SETC __QD3DVIEW__ := 1}
  28.  
  29. {$I+}
  30. {$SETC QD3DViewIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __QD3D__}
  34. {$I QD3D.p}
  35. {$ENDC}
  36.  
  37. {$IFC UNDEFINED __QD3DSTYLE__}
  38. {$I QD3DStyle.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __QD3DSET__}
  41. {$I QD3DSet.p}
  42. {$ENDC}
  43.  
  44.  
  45. {$PUSH}
  46. {$ALIGN POWER}
  47. {$LibExport+}
  48.  
  49. {*****************************************************************************
  50.  **                                                                             **
  51.  **                        View Type Definitions                                 **
  52.  **                                                                             **
  53.  ****************************************************************************}
  54.  
  55. TYPE
  56.     TQ3ViewStatus                 = LONGINT;
  57. CONST
  58.     kQ3ViewStatusDone            = {TQ3ViewStatus}0;
  59.     kQ3ViewStatusRetraverse        = {TQ3ViewStatus}1;
  60.     kQ3ViewStatusError            = {TQ3ViewStatus}2;
  61.     kQ3ViewStatusCancelled        = {TQ3ViewStatus}3;
  62.  
  63.  
  64. {*****************************************************************************
  65.  **                                                                             **
  66.  **                        Default Attribute Set                                 **
  67.  **                                                                             **
  68.  ****************************************************************************}
  69.  
  70. {*****************************************************************************
  71.  **                                                                             **
  72.  **                            View Routines                                     **
  73.  **                                                                             **
  74.  ****************************************************************************}
  75. FUNCTION Q3View_New: TQ3ViewObject; C;
  76. FUNCTION Q3View_Cancel(view: TQ3ViewObject): TQ3Status; C;
  77. {*****************************************************************************
  78.  **                                                                             **
  79.  **                        View Rendering routines                                 **
  80.  **                                                                             **
  81.  ****************************************************************************}
  82. FUNCTION Q3View_SetRendererByType(view: TQ3ViewObject; theType: TQ3ObjectType): TQ3Status; C;
  83. FUNCTION Q3View_SetRenderer(view: TQ3ViewObject; renderer: TQ3RendererObject): TQ3Status; C;
  84. FUNCTION Q3View_GetRenderer(view: TQ3ViewObject; VAR renderer: TQ3RendererObject): TQ3Status; C;
  85. FUNCTION Q3View_StartRendering(view: TQ3ViewObject): TQ3Status; C;
  86. FUNCTION Q3View_EndRendering(view: TQ3ViewObject): TQ3ViewStatus; C;
  87. FUNCTION Q3View_Flush(view: TQ3ViewObject): TQ3Status; C;
  88. FUNCTION Q3View_Sync(view: TQ3ViewObject): TQ3Status; C;
  89.  
  90. {*****************************************************************************
  91.  **                                                                             **
  92.  **                        View/Bounds/Pick routines                             **
  93.  **                                                                             **
  94.  ****************************************************************************}
  95. FUNCTION Q3View_StartBoundingBox(view: TQ3ViewObject; computeBounds: TQ3ComputeBounds): TQ3Status; C;
  96. FUNCTION Q3View_EndBoundingBox(view: TQ3ViewObject; VAR result: TQ3BoundingBox): TQ3ViewStatus; C;
  97. FUNCTION Q3View_StartBoundingSphere(view: TQ3ViewObject; computeBounds: TQ3ComputeBounds): TQ3Status; C;
  98. FUNCTION Q3View_EndBoundingSphere(view: TQ3ViewObject; VAR result: TQ3BoundingSphere): TQ3ViewStatus; C;
  99. FUNCTION Q3View_StartPicking(view: TQ3ViewObject; pick: TQ3PickObject): TQ3Status; C;
  100. FUNCTION Q3View_EndPicking(view: TQ3ViewObject): TQ3ViewStatus; C;
  101.  
  102. {*****************************************************************************
  103.  **                                                                             **
  104.  **                            View/Camera routines                             **
  105.  **                                                                             **
  106.  ****************************************************************************}
  107. FUNCTION Q3View_GetCamera(view: TQ3ViewObject; VAR camera: TQ3CameraObject): TQ3Status; C;
  108. FUNCTION Q3View_SetCamera(view: TQ3ViewObject; camera: TQ3CameraObject): TQ3Status; C;
  109.  
  110. {*****************************************************************************
  111.  **                                                                             **
  112.  **                            View/Lights routines                             **
  113.  **                                                                             **
  114.  ****************************************************************************}
  115. FUNCTION Q3View_SetLightGroup(view: TQ3ViewObject; lightGroup: TQ3GroupObject): TQ3Status; C;
  116. FUNCTION Q3View_GetLightGroup(view: TQ3ViewObject; VAR lightGroup: TQ3GroupObject): TQ3Status; C;
  117.  
  118. {*****************************************************************************
  119.  **                                                                             **
  120.  **                                Idle Method                                     **
  121.  **                                                                             **
  122.  ****************************************************************************}
  123. {
  124.  *    The idle methods allow the application to register callback routines 
  125.  *    which will be called by the view during especially long operations.
  126.  *
  127.  *    The idle methods may also be used to interrupt long renderings or
  128.  *    traversals.  Inside    the idler callback the application can check for
  129.  *    Command-Period, Control-C or clicking a "Cancel" button or whatever else
  130.  *    may be used to let the user interrupt rendering.    
  131.  *
  132.  *    It is NOT LEGAL to call QD3D routines inside an idler callback.
  133.  *
  134.  *    Return kQ3Failure to cancel rendering, kQ3Success to continue. Don't
  135.  *    bother posting an error.
  136.  *
  137.  *    Q3View_SetIdleMethod registers a callback that can be called
  138.  *    by the system during rendering.  Unfortunately there is no way yet
  139.  *    to set timer intervals when you want to be called.  Basically, it is
  140.  *    up to the application's idler callback to check clocks to see if you
  141.  *    were called back only a millisecond ago or an hour ago!
  142.  *
  143.  *    Q3View_SetIdleProgressMethod registers a callback that also gives
  144.  *    progress information. This information is supplied by the renderer, and
  145.  *    may or may not be based on real time.
  146.  *
  147.  *    If a renderer doesn't support the progress method, your method will be
  148.  *    called with current == 0 and completed == 0.
  149.  *    
  150.  *    Otherwise, you are GUARANTEED to get called at least 2 or more times:
  151.  *    
  152.  *    ONCE            idleMethod(view, 0, n)        -> Initialize, Show Dialog
  153.  *    zero or more    idleMethod(view, 1..n-1, n) -> Update progress
  154.  *    ONCE            idleMethod(view, n, n)        -> Exit, Hide Dialog
  155.  *    
  156.  *    "current" is guaranteed to be less than or equal to "completed"
  157.  *    "completed" may change values, but current/complete always indicates
  158.  *    the degree of completion.
  159.  *
  160.  *    The calling conventions aid in managing any data associated with a 
  161.  *    progress user interface indicator.
  162.  }
  163.  
  164. TYPE
  165. {$IFC TYPED_FUNCTION_POINTERS}
  166.     TQ3ViewIdleMethod = FUNCTION(view: TQ3ViewObject; idlerData: UNIV Ptr): TQ3Status; C;
  167. {$ELSEC}
  168.     TQ3ViewIdleMethod = ProcPtr;
  169. {$ENDC}
  170.  
  171. {$IFC TYPED_FUNCTION_POINTERS}
  172.     TQ3ViewIdleProgressMethod = FUNCTION(view: TQ3ViewObject; idlerData: UNIV Ptr; current: UInt32; completed: UInt32): TQ3Status; C;
  173. {$ELSEC}
  174.     TQ3ViewIdleProgressMethod = ProcPtr;
  175. {$ENDC}
  176.  
  177. FUNCTION Q3View_SetIdleMethod(view: TQ3ViewObject; idleMethod: TQ3ViewIdleMethod; idleData: UNIV Ptr): TQ3Status; C;
  178. FUNCTION Q3View_SetIdleProgressMethod(view: TQ3ViewObject; idleMethod: TQ3ViewIdleProgressMethod; idleData: UNIV Ptr): TQ3Status; C;
  179.  
  180. {*****************************************************************************
  181.  **                                                                             **
  182.  **                                EndFrame Method                                 **
  183.  **                                                                             **
  184.  ****************************************************************************}
  185. {
  186.  *    The end frame method is an alternate way of determining when an
  187.  *    asynchronous renderer has completed rendering a frame. It differs from
  188.  *    Q3View_Sync in that notification of the frame completion is the opposite
  189.  *    direction. 
  190.  *    
  191.  *    With Q3View_Sync the application asks a renderer to finish rendering
  192.  *    a frame, and blocks until the frame is complete.
  193.  *    
  194.  *    With the EndFrame method, the renderer tells the application that is has
  195.  *    completed a frame.
  196.  *
  197.  *    If "Q3View_Sync" is called BEFORE this method has been called, this
  198.  *    method will NOT be called ever.
  199.  *    
  200.  *    If "Q3View_Sync" is called AFTER this method has been called, the
  201.  *    call will return immediately (as the frame has already been completed).
  202.  }
  203.  
  204. TYPE
  205. {$IFC TYPED_FUNCTION_POINTERS}
  206.     TQ3ViewEndFrameMethod = PROCEDURE(view: TQ3ViewObject; endFrameData: UNIV Ptr); C;
  207. {$ELSEC}
  208.     TQ3ViewEndFrameMethod = ProcPtr;
  209. {$ENDC}
  210.  
  211. FUNCTION Q3View_SetEndFrameMethod(view: TQ3ViewObject; endFrame: TQ3ViewEndFrameMethod; endFrameData: UNIV Ptr): TQ3Status; C;
  212.  
  213. {*****************************************************************************
  214.  **                                                                             **
  215.  **                            Push/Pop routines                                 **
  216.  **                                                                             **
  217.  ****************************************************************************}
  218. FUNCTION Q3Push_Submit(view: TQ3ViewObject): TQ3Status; C;
  219. FUNCTION Q3Pop_Submit(view: TQ3ViewObject): TQ3Status; C;
  220.  
  221. {*****************************************************************************
  222.  **                                                                             **
  223.  **        Check if bounding box is visible in the viewing frustum.  Transforms **
  224.  **        the bbox by the current local_to_world transformation matrix and     **
  225.  **        does a clip test to see if it lies in the viewing frustum.             **
  226.  **        This can be used by applications to cull out large chunks of scenes     **
  227.  **        that are not going to be visible.                                     **
  228.  **                                                                             **
  229.  **        The default implementation is to always return kQ3True.  Renderers     **
  230.  **        may override this routine however to do the checking.                 **
  231.  **                                                                             **
  232.  ****************************************************************************}
  233. FUNCTION Q3View_IsBoundingBoxVisible(view: TQ3ViewObject; {CONST}VAR bbox: TQ3BoundingBox): TQ3Boolean; C;
  234.  
  235. {*****************************************************************************
  236.  **                                                                             **
  237.  **                            DrawContext routines                             **
  238.  **                                                                             **
  239.  ****************************************************************************}
  240. FUNCTION Q3View_SetDrawContext(view: TQ3ViewObject; drawContext: TQ3DrawContextObject): TQ3Status; C;
  241. FUNCTION Q3View_GetDrawContext(view: TQ3ViewObject; VAR drawContext: TQ3DrawContextObject): TQ3Status; C;
  242.  
  243. {*****************************************************************************
  244.  **                                                                             **
  245.  **                            Graphics State routines                             **
  246.  **                                                                             **
  247.  ** The graphics state routines can only be called while rendering (ie. in     **
  248.  ** between calls to start and end rendering calls).  If they are called     **
  249.  ** outside of a rendering loop, they will return with error.                 **
  250.  **                                                                             **
  251.  ****************************************************************************}
  252. {*****************************************************************************
  253.  **                                                                             **
  254.  **                            Transform routines                                 **
  255.  **                                                                             **
  256.  ****************************************************************************}
  257. FUNCTION Q3View_GetLocalToWorldMatrixState(view: TQ3ViewObject; VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  258. FUNCTION Q3View_GetWorldToFrustumMatrixState(view: TQ3ViewObject; VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  259. FUNCTION Q3View_GetFrustumToWindowMatrixState(view: TQ3ViewObject; VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  260.  
  261. {*****************************************************************************
  262.  **                                                                             **
  263.  **                            Style state routines                             **
  264.  **                                                                             **
  265.  ****************************************************************************}
  266. FUNCTION Q3View_GetBackfacingStyleState(view: TQ3ViewObject; VAR backfacingStyle: TQ3BackfacingStyle): TQ3Status; C;
  267. FUNCTION Q3View_GetInterpolationStyleState(view: TQ3ViewObject; VAR interpolationType: TQ3InterpolationStyle): TQ3Status; C;
  268. FUNCTION Q3View_GetFillStyleState(view: TQ3ViewObject; VAR fillStyle: TQ3FillStyle): TQ3Status; C;
  269. FUNCTION Q3View_GetHighlightStyleState(view: TQ3ViewObject; VAR highlightStyle: TQ3AttributeSet): TQ3Status; C;
  270. FUNCTION Q3View_GetSubdivisionStyleState(view: TQ3ViewObject; VAR subdivisionStyle: TQ3SubdivisionStyleData): TQ3Status; C;
  271. FUNCTION Q3View_GetOrientationStyleState(view: TQ3ViewObject; VAR fontFacingDirectionStyle: TQ3OrientationStyle): TQ3Status; C;
  272. FUNCTION Q3View_GetReceiveShadowsStyleState(view: TQ3ViewObject; VAR receives: TQ3Boolean): TQ3Status; C;
  273. FUNCTION Q3View_GetPickIDStyleState(view: TQ3ViewObject; VAR pickIDStyle: UInt32): TQ3Status; C;
  274. FUNCTION Q3View_GetPickPartsStyleState(view: TQ3ViewObject; VAR pickPartsStyle: TQ3PickParts): TQ3Status; C;
  275. FUNCTION Q3View_GetAntiAliasStyleState(view: TQ3ViewObject; VAR antiAliasData: TQ3AntiAliasStyleData): TQ3Status; C;
  276.  
  277. {*****************************************************************************
  278.  **                                                                             **
  279.  **                        Attribute state routines                             **
  280.  **                                                                             **
  281.  ****************************************************************************}
  282. FUNCTION Q3View_GetDefaultAttributeSet(view: TQ3ViewObject; VAR attributeSet: TQ3AttributeSet): TQ3Status; C;
  283. FUNCTION Q3View_SetDefaultAttributeSet(view: TQ3ViewObject; attributeSet: TQ3AttributeSet): TQ3Status; C;
  284.  
  285. FUNCTION Q3View_GetAttributeSetState(view: TQ3ViewObject; VAR attributeSet: TQ3AttributeSet): TQ3Status; C;
  286. FUNCTION Q3View_GetAttributeState(view: TQ3ViewObject; attributeType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  287.  
  288.  
  289. {$ALIGN RESET}
  290. {$POP}
  291.  
  292. {$SETC UsingIncludes := QD3DViewIncludes}
  293.  
  294. {$ENDC} {__QD3DVIEW__}
  295.  
  296. {$IFC NOT UsingIncludes}
  297.  END.
  298. {$ENDC}
  299.